/**
 * Created by Administrator on 2016/1/18.
 */

var events = require("events");

var emitter = new events.EventEmitter();

emitter.on("111", function(arg1, arg2) {
    console.log("111事件触发！value：" + parseInt(arg1 + arg2));
});

emitter.on("111", function(arg1, arg2) {
    console.log("111事件触发！value：" + parseInt(arg1 - arg2));
});

var TestFunc = function() {
    console.log("TEST addEventListener");
}

emitter.on("listener", TestFunc);

setTimeout(function() {
    emitter.emit("111", 5, 2);
}, 2000);

emitter.emit("listener", TestFunc);

//emitter.removeListener("listener", TestFunc);
